<!-- eslint-disable vue/multi-word-component-names -->
<!-- eslint-disable vue/valid-template-root -->

<template>

    <el-form v-model="form" label-width="auto" style="max-width: 600px">
        <el-form-item label="账户名">
            <el-input v-model="form.username" />
        </el-form-item>
        <el-form-item label="密码">
            <el-input v-model="form.pwd" />
        </el-form-item>
        <el-form-item label="账户类型">
            <el-radio-group v-model="form.role">
                <el-radio v-bind:value="1">个人账户</el-radio>
                <el-radio v-bind:value="2">公司账户</el-radio>
            </el-radio-group>
        </el-form-item>
        <el-form-item>
            <el-button type="primary" @click="handle1">登录</el-button>
            <el-button type="success" @click="handle2">注册</el-button>
        </el-form-item>
    </el-form>

</template>


<script>
import router from '@/router';
export default {
    data() {
        return {
            form: {
                username: 'admin',
                pwd: '1000',
                role: 2
            }
        }
    },
    methods: {
        handle1() {
            if(this.form.role===1){
                router.replace('/user')
            }else{
                router.replace('/company')
            }
            
        },
        handle2() {
            
        }
    }
}
</script>

<style scoped></style>